<template>
  <div>
    <Chart :cdata="cdata" />
  </div>
</template>

<script>
import Chart from './chart.vue';
export default {
  props: {
    chartData: {
      type: Object,
      required: true
    }
  },
  data () {
    return {
      cdata: {
        category: [
          "照明",
          "新风",
          "排风",
          "空调",
          "控制器"
        ],
        lineData: [
          0,
          0,
          0,
          0,
          0
        ],
        barData: [
          0,
          0,
          0,
         0,
         0
        ]
      }
    }
  },
  components: {
    Chart,
  },
  mounted () {
  },
  methods: {
  },
  watch: {
    chartData: {
      handler (newData) {
        if(newData.category.length > 0) {
          this.cdata = newData
        }
      },
      immediate: true,
      deep: true
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
